﻿<XmlReplacementTests>
  <!-- Should Succeed -->
  <Test>
    <FilePath>TestLib.nuspec</FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>true</ExpectedResult>
    <ExpectedException>None</ExpectedException>
  </Test>
  <!-- File Not Found -->
  <Test>
    <FilePath>FileNotFound</FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>FileNotFoundException</ExpectedException>
  </Test>
  <!-- Missing Parameters -->
  <Test>
    <FilePath></FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath>TestLib.nuspec</FilePath>
    <ReplacementValue></ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath>TestLib.nuspec</FilePath>
    <ReplacementValue>1.2.1.2</ReplacementValue>
    <XPathExpression></XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath></FilePath>
    <ReplacementValue></ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath></FilePath>
    <ReplacementValue>1.2.1.4</ReplacementValue>
    <XPathExpression></XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath>TestLib.nuspec</FilePath>
    <ReplacementValue></ReplacementValue>
    <XPathExpression></XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath></FilePath>
    <ReplacementValue></ReplacementValue>
    <XPathExpression></XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <!-- Testing the namespace parms -->
  <Test>
    <FilePath>TestLib.nuspec</FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace></XmlNamespace>
    <XmlNamespacePrefix>ns</XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath>TestLib.nuspec</FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>ns:package/ns:metadata/ns:version</XPathExpression>
    <XmlNamespace>http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd</XmlNamespace>
    <XmlNamespacePrefix></XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
  <Test>
    <FilePath>NoNamespace.xml</FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>package/metadata/version</XPathExpression>
    <XmlNamespace></XmlNamespace>
    <XmlNamespacePrefix></XmlNamespacePrefix>
    <ExpectedResult>true</ExpectedResult>
    <ExpectedException>None</ExpectedException>
  </Test>
  <Test>
    <FilePath>NoNamespace.xml</FilePath>
    <ReplacementValue>1.2.3.4</ReplacementValue>
    <XPathExpression>package/metadata/wrongelement</XPathExpression>
    <XmlNamespace></XmlNamespace>
    <XmlNamespacePrefix></XmlNamespacePrefix>
    <ExpectedResult>false</ExpectedResult>
    <ExpectedException>ArgumentException</ExpectedException>
  </Test>
</XmlReplacementTests>